<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/layouts/include/taglib.jsp" %>

<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta name="decorator" content="step"/>

    <style type="text/css">
        /*模态提示框样式  start*/
        .modal-backdrop {
            position: fixed;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            z-index: 1030;
            background-color: #FFFFFF;
        }

        .modal-backdrop.in {
            opacity: 0.2;
            filter: alpha(opacity=50);
        }

        /*模态提示框样式  end*/

    </style>

    <script type="text/javascript">
        var memberArray = new Array();		//成员缓存
        var prjId = "${param.prjId}";		//项目id
        var GLOBAL_PRJTYPE;					//项目类型
        var GOBAL_CUST_NO = '<shiro:principal property="empNo"/>'; //当前用户名
        var GOBAL_PRJ_ROLE; 				//当前项目角色
        var GOBAL_PRJ_STEPLIST; 			//当前项目阶段
        var GLOBAL_PRJ;  					//当前项目信息
    </script>
	
</head>
<body>

    <div class="step-main padding-right-200">
        <div class="row">
            <div class="step-header">
                <h1><i class="icon-caret-right"></i> 
                <span id="setPrjName"></span><br />
                <small id="setprjStatus" style="color:red"></small></h1>
                
                <div class="pull-right" style="height:49px;line-height:39px;" >	
	        		<a class="btn-ace pull-right setting_project_info" href="stepCfg.jsp?prjId=${param.prjId}" group='status' >
	        					<i class="icon-cog"></i>
	        					项目设置、审核
	        		</a>  
	                <a href="#" class="btn-ace pull-right begin-project-btn" onclick='beginProject();return false;'>
	                           <i class="icon-tags"></i>
	                           	 开始项目
	                </a> 
	                <a href="#" class="btn-ace pull-right show-project-btn" onclick='showProject(this);return false;'>
	                           <i class="icon-tags"></i>
	                           	查看审核信息
	                </a> 
	       		</div>
            </div>
           
            <div>
            	<!-- 进度向导 -->
            	<ul class="wizard-steps" id="wizard-steps">
				</ul>
            </div>
        </div>
        <div class="step-content">
        	
        	<div class="pull-left" style="height:35px;" id="searchCond">	<!-- 查询条件 -->
        		<a class="btn-search" href="#" group='empNo' key='<shiro:principal property="empNo"/>'>我的任务</a>  
        		<a class="btn-search selected" href="#" group='empNo' key=''>全部</a> | 
        		<a class="btn-search" href="#" group='status' key='30050001'>未开始</a>  
        		<a class="btn-search" href="#" group='status' key='30050002'>进行中</a> 
        		<a class="btn-search" href="#" group='status' key='30050003'>待确认</a>  
        		<a class="btn-search" href="#" group='status' key='30050004'>完成</a>  
        		<a class="btn-search selected" href="#" group='status' key=''>全部</a>
        		
       		</div>
       		<div class="step-switch" id="searchCondRight">
        		<a class="selected" href="" id="taskRight">任务</a>
        		<a class="" href="" id="selecctFruit">成果</a>
        	</div>
       		
       		
            <div class="steprow thin-scroll" id="taskListRow">
            	
            </div>
			 <div class="achievementrow thin-scroll" id="becomeFruit">
				<div class="achievementfiles thin-scroll ztree" id="projectTree">
					
				</div>
				<!-- TODO 显示评论 -->
				<div class="achievementcomments thin-scroll">
					<div class="commentListForDoc">
							<a href="#" id="comment-download-file"><i class="icon-download-alt"></i> 下载文档</a>
							&nbsp;&nbsp;
							<a href="#" id="comment-submit-doc" class="submit-audit"><i class="icon-hand-up"></i> 提交审核</a>
							&nbsp;&nbsp;
							<a href="#" id="comment-audit-success" class="audit-operation"><i class="icon-share-alt"></i> 文档审核</a>
							
							<br><br>
							<a href="#" id="comment-btn-new-doc"><i class="icon-plus"></i> 新增评论</a>
							
							<div id="comment-form-div-top-doc">
								<div id="comment-form-div-doc">
									<br>
									<form action="" id="comment-form-doc">
										<input type="hidden" name="busitableKey" id="busitableKeyDoc"/>
										<input type="hidden" name="parentId"  id="parentIdDoc" />
										<input type="hidden" name="topId"  id="topIdDoc" />
										<textarea rows="3" cols="50" class="form-group input-sm" id="commentDoc" name="comment" placeholder="我也说一句" ></textarea>
										<div>
											<div class="col-sm-5"></div>
											<div class="col-sm-7">
												<a href="#"  id="comment-btn-save-doc"><i class="icon-ok-circle"></i>评论</a>
												&nbsp;&nbsp;
												<a href="#" id="comment-btn-close-doc"><i class="icon-remove-circle"></i>取消</a>
											</div>
										</div>
									</form>
								</div> 
							</div>
							<div class="col-sm-12">
								<ul id="commentListDoc">
									
								</ul>
								
							</div>
							
							
						</div>
				
				</div>
				<div class="achievement-comment-doc thin-scroll">
					<div id="comments-doc-list-div" class="commentsdoclistdiv">
						<input type="hidden" id="file-uuid">
						<a href="#" id="comment-upload-doc"><i class="icon-upload"></i> 上传意见文档</a>
						 <!-- 进度条  -->
							<div class="progress progress-striped active" id="file-active-comment" style="display: none">
								<div class="progress-bar progress-bar-success" id="progress-doc" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">
									<span class="sr-only">上传中</span>
								</div>
							</div>
						<div id="comments-doc-list">
							
						</div>
					</div>
					
				</div>

			</div> 
			
            <div class="modal fade in" id="stepModen"><!-- class="modal fade" 添加效果 -->
                <div class="modal-dialog" style="width:250px;">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                            <h4 class="modal-title">新增阶段</h4>
                        </div>
                        <div class="modal-body">
                            <form class="form-horizontal" role="form" id="stepModen-form">
                                <div class="form-group">
                                	<div class="col-sm-offset-1 col-sm-10 input-group">
                                        <input type="hidden" name="uuid"/>
                                        <input type="hidden" name="prjId"/>
                                        <input type="text" name="stepName" placeholder="阶段名" class="col-sm-12"/>
                                     </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-offset-1 col-sm-10 input-group">
                                        <input type="text" data-provide="datepicker"  name="endDate" placeholder="结束日期" class="form-control"/>
                                        <span class="input-group-addon">
											<i class="icon-calendar"></i>
										</span>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                            <button type="button" class="btn btn-primary" id="stepModen-btn-save">保存</button>
                        </div>
                    </div>
                    <!-- /.modal-content -->
                </div>
                <!-- /.modal-dialog -->
            </div>
            <!-- 审核信息详情模板 -->
            <div class="modal fade in" id="audit-message"><!-- class="modal fade" 添加效果 -->
                <div class="modal-dialog" style="width:600px;">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                            <h4 class="modal-title">项目审核信息</h4>
                        </div>
                        <div class="modal-body">
                            <p >项目名称:&nbsp;&nbsp;<font size="3"><span id="project-name"></span></font></p>
                            <div>
                            	<ul id="comments">
				
								</ul>
                            </div>    	
                                
                                	
                                   
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        </div>
                    </div>
                    <!-- /.modal-content -->
                </div>
                <!-- /.modal-dialog -->
            </div>
            
            <!-- 文档审核模板 -->
            <div class="modal fade in" id="audit-doc"><!-- class="modal fade" 添加效果 -->
                <div class="modal-dialog" style="width:600px;">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                            <h4 class="modal-title">文档审核</h4>
                        </div>
                        <div class="modal-body">
                            <form class="form-horizontal" role="form" id="audit-doc-form">
                                <div class="form-group">
                                	<label class="col-sm-2 control-label " for="docName">文档名称 </label>
                                	<div class="col-sm-offset-1 col-sm-10 input-group">
                                        <input type="hidden" name="docId"/>
                                        <input type="text" name="docName"  class="col-sm-12" readonly="readonly"/>
                                     </div>
                                </div>
                                <div class="form-group">
                                	<label class="col-sm-2 control-label " for="comment">指导意见 </label>
                                    <div class="col-sm-offset-1 col-sm-10 input-group">
                                         <textarea rows="5" name="comment" placeholder="指导意见" class="col-sm-12"></textarea>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                            <button type="button" class="btn btn-primary" id="audit-doc-btn-agree">通过</button>
                            <button type="button" class="btn btn-primary" id="audit-doc-btn-disAgree">不通过</button>
                        </div>
                    </div>
                    <!-- /.modal-content -->
                </div>
                <!-- /.modal-dialog -->
            </div>
            <!-- /.modal -->
			
			<!-- 任务详情模板 -->
			<jsp:include page="taskEditModel.jsp"></jsp:include>

			

        </div>
    </div>

   	<jsp:include page="projectMember.jsp"></jsp:include>
	
	
	<jsp:include page="selectMember.jsp"></jsp:include> 
	
	
	
	

<!-- 阶段向导模板 -->
<script id="stepWizardMtp" type="x-tmpl-mustache">
	{{#data}}
	<li class="{{stepStyle}}" id="step-wizard-{{uuid}}">
		<a stepId="{{uuid}}">
			<span class="step">{{sort}}</span>
			<span class="title">{{stepName}}</span>
		</a>
	</li>
	{{/data}}
</script>

<!-- 任务项模板 -->
<script id="taskItemMtp" type="x-tmpl-mustache">
	<li class="clearfix task-item" key="{{uuid}}" id="task-item-panel-{{uuid}}" empNo="{{empNo}}">
		<label class="inline">
			<span class="lbl">{{taskName}}</span>
		</label>
		<div class="taskiteminfo">
			<span><i class="icon-comments"></i></span>
			<span><i class="icon-time"></i> {{startDateFormat}}----{{endDateFormat}}</span>
		</div>
		<div class="taskiteminfo">
			<span><i class="icon-user"></i> {{empNames}}</span>
			<span class="pull-right {{itemStatusStyle}}"><i class="icon-tags"></i> {{itemStatusName}}</span>
		</div>
	</li>
</script>

<!-- 选择审核人员模板 -->
<script id="selectAuditMtp" type="x-tmpl-mustache">
	<li class="clearfix task-item" key="{{uuid}}" id="task-item-panel-{{uuid}}" empNo="{{empNo}}">
		<label class="inline">
			<span class="lbl">{{taskName}}</span>
		</label>
		<div class="taskiteminfo">
			<span><i class="icon-comments"></i> 0</span>
			<span><i class="icon-time"></i> {{startDateFormat}}----{{endDateFormat}}</span>
		</div>
		<div class="taskiteminfo">
			<span><i class="icon-user"></i> {{empNames}}</span>
			<span class="pull-right {{itemStatusStyle}}"><i class="icon-tags"></i> {{itemStatusName}}</span>
		</div>
	</li>
</script>
	

<!-- 任务列表模板 -->
<script id="taskListMtp" type="x-tmpl-mustache">
	{{#data}}
	<ul class="item-list" id="step-wrap-ul-{{stepId}}">
		{{#taskList}}
			{{#filterFn}}
				{{>taskItemLink}}
			{{/filterFn}}
		{{/taskList}}
	</ul>                	
	{{/data}}
</script>

<!-- 文档评论显示板块 -->
<script id="commentMtDoc" type="x-tmpl-mustache">

	{{#data}}					
	<li>
			&nbsp;<small style="color:silver;">{{createEmp}}</small>&nbsp;回复&nbsp;<small style="color:silver;">{{replyToEmp}}</small>
			&nbsp;：{{comment}}&nbsp;&nbsp;{{#formatDt}}{{createDt}}{{/formatDt}}&nbsp;&nbsp;&nbsp;&nbsp;
			{{#isNotMyself}}
				<span  class="replyComment" id="{{uuid}}" topId="{{topId}}" replyToEmp="{{createEmp}}" replyToEmpNo="{{createEmpNo}}"><i class="icon-comment-alt"></i></span>
			{{/isNotMyself}}	
			{{#isMyselfCmt}}
			&nbsp;&nbsp;<span id="{{uuid}}" class="deleteComment" style="color:red"><i class="icon-trash"></i></span>
			{{/isMyselfCmt}}
			<div id="reply{{uuid}}"></div>
			{{#childList}}	
				<ul>
					<li class="childStyle" type="circle" style="padding:0 0 0 10px;">
							&nbsp;<small style="color:silver;">{{createEmp}}</small>&nbsp;回复&nbsp;<small style="color:silver;">{{replyToEmp}}</small>
							&nbsp;：{{comment}}&nbsp;&nbsp;{{#formatDt}}{{createDt}}{{/formatDt}}&nbsp;&nbsp;&nbsp;&nbsp;
							{{#isNotMyself}}
								<span  class="replyComment" id="{{uuid}}" topId="{{topId}}" replyToEmp="{{createEmp}}" replyToEmpNo="{{createEmpNo}}"><i class="icon-comment-alt"></i></span>
							{{/isNotMyself}}	
							{{#isMyselfCmt}}
							&nbsp;&nbsp;<span id="{{uuid}}" class="deleteComment" style="color:red" ><i class="icon-trash"></i></span>
							{{/isMyselfCmt}}
							<div id="reply{{uuid}}"></div>
					</li>
				</ul>
			{{/childList}}
			
	</li>
	{{/data}}
</script>


<!-- 任务新增模板 -->
<script id="taskAddMtp" type="x-tmpl-mustache">
	<li class="item-task-add clearfix" id="task-wrap-{{stepId}}">
		<form class="form-horizontal" role="form" id="task-save-form">
			<div class="row">
				<div class="col-sm-12 f-mb10">
					<input type="hidden" name="uuid"/>
					<input type="hidden" name="prjId"  value="{{prjId}}"/>	  {{!prjId jsp页面全局变量}}
					<input type="hidden" name="stepId" value="{{stepId}}"/>
					<input type="hidden" name="empNo"/>
					<input type="hidden" name="endDate"/>
					<input type="text" name="taskName" placeholder="任务名" class="col-sm-12"/>
				</div>
				<div class="col-sm-12 f-mb10" id="divTaskType">
				</div>
				<div class="col-sm-6 f-mb10">
					<div class="inline position-relative">
						<a href="#" class="user-title-label dropdown-toggle emp-dropdown-toggle" data-toggle="dropdown">
							<i class="icon-user orange bigger-130"></i>
							<span>选择人员..</span>
						</a>
						<ul class="align-left dropdown-menu dropdown-caret dropdown-lighter">
							{{>taskMemberListMtp}}
						</ul>
					</div>
				</div>
				<div class="col-sm-6 f-mb10"><a class="div-datepicker" href="#"><i class="icon-calendar orange bigger-130"></i><span>截至日期</span></a></div>
					<div class="col-sm-12 f-mb10">
						<textarea class="form-control limited" name="depict" placeholder="描述" maxlength="200"></textarea>
					</div>
					<div class="col-sm-12 f-mb10 clearfix">
						<button type="button" class="btn btn-primary submit-handler pull-right" data-toggle="button" id="task-btn-save">创建</button>
						<button type="button" class="btn btn-link cancel-handler pull-right" data-toggle="button" id="task-btn-cancle">取消</button>
					</div>
				</div> 
			</div> 
		</form>
	</li>
</script>



<!-- 任务成员列表模板 -->
<script id="taskMemberListMtp" type="x-tmpl-mustache">
		<li class="dropdown-header"> 成员列表 </li>
		{{#memberArray}}
			<li>	
				<a>					
					<i class="icon-circle green"></i>					
					<span class="green" value="{{empNo}}">{{empName}}</span>					
				</a>					
			</li>
		{{/memberArray}}
</script>

<script>
		setting = {					
				view : {
					selectedMulti : false
				},
				data : {
					 key:{
						name:"showName"
					},
					simpleData : {
						enable : true,
						idKey : "uuid",
						pIdKey : "parentId",
					} 
				},
				callback:{
					onClick : zTreeOnClick
				}
				
		};
		/* 显示文件信息 */
		function zTreeOnClick(event, treeId, treeNode){
			if(treeNode.folderType=="40010002"){	
				clickFolderFn(treeNode.uuid,treeNode.showName,treeNode.status);
				
			}else{
				$(".commentListForDoc").hide();
				$(".commentsdoclistdiv").hide();
			}
			
		}
</script>

<!--项目审核信息显示板块 -->
<script id="auditMt" type="x-tmpl-mustache">

	{{#data}}					
	<li>
			&nbsp;&nbsp;<small style="color:silver;">{{updateEmp}}</small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<small style="color:blue;">{{status}}</small>
			<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size="4">{{comment}}</font>
	</li>
	{{/data}}
</script>

<script type="text/javascript" src="step.js"></script>
<script type="text/javascript" src="comments.js"></script>
<script type="text/javascript" src="docComments.js"></script>
<script type="text/javascript" src="taskEditModel.js"></script>
<script type="text/javascript" src="projectMember.js"></script>

<span style="display:none;">
	<div id="tagsSelect">
		<tags:select type="pmTaskType" name="taskType" id="taskTypeHidden" hasBlank="true"></tags:select>
	</div>
</span>
</body>

